package cn.com.lyj6851.modules.activity.controller;

import cn.com.lyj6851.logging.aop.AopLog;
import cn.com.lyj6851.modules.activity.service.YdyStoreCouponUserService;
import cn.com.lyj6851.modules.activity.service.dto.YdyStoreCouponUserQueryCriteria;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* 
*/
@Api(tags = "商城:优惠券发放记录管理")
@RestController
@RequestMapping("api")
public class StoreCouponUserController {

    private final YdyStoreCouponUserService yxStoreCouponUserService;

    public StoreCouponUserController(YdyStoreCouponUserService yxStoreCouponUserService) {
        this.yxStoreCouponUserService = yxStoreCouponUserService;
    }

    @AopLog("查询Y")
    @ApiOperation(value = "查询")
    @GetMapping(value = "/ydyStoreCouponUser")
    @PreAuthorize("hasAnyRole('admin','STORECOUPONUSER_ALL','STORECOUPONUSER_SELECT')")
    public ResponseEntity getYdyStoreCouponUsers(YdyStoreCouponUserQueryCriteria criteria, Pageable pageable){
        return new ResponseEntity(yxStoreCouponUserService.queryAll(criteria,pageable),HttpStatus.OK);
    }


}